package com.wondersgroup.framework.sample.component.demoform.action;

import com.wondersgroup.framework.core.web.struts2.action.BaseAjaxAction;
import com.wondersgroup.framework.sample.component.demoform.vs.DemoVS;

public class HtmlEditorAction extends BaseAjaxAction {

	private DemoVS demoVS;
	private String messageContext;

	public String getMessageContext() {
		return messageContext;
	}

	public void setMessageContext(String messageContext) {
		this.messageContext = messageContext;
	}

	public DemoVS getDemoVS() {
		return demoVS;
	}

	public void setDemoVS(DemoVS demoVS) {
		this.demoVS = demoVS;
	}

	@Override
	public String operate() {
		String result = prefix + suffex;
		return result;
	}

	public String loadFormWithHtmlEditor() {
		String messageContext = "<A href='http://www.baidu.com/' target='_blank'>百度主页</A>";
		String json = prefix + "{\"messageContext\":" + "\"" + messageContext
				+ "\"" + "}" + suffex;
		createJSonData(json);
		return AJAX;
	}

	public String submitFormWithHtmlEditor() {
		logger.error("messageContext=" + this.messageContext);
		createJSonData(prefix + suffex);
		return AJAX;
	}
}
